package cn.zane.designPattern.createPatterns.singletonPatterns.design;

/**
 * @Author: zane
 * @Date: 2025/01/05
 * @Description: 懒汉模式(线程安全)-synchronized方式-(synchronized 是对懒汉模式的改进，但是性能不佳)
 */
public class Singleton_02 {

    private Singleton_02() {
    }

    private static Singleton_02 instance;

    public static synchronized Singleton_02 getInstance2() {
        if (null == instance) {
            instance = new Singleton_02();
        }
        return instance;
    }
}
